home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13063 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: red.seas.upenn.edu!mchyzer
  2. From: mchyzer@red.seas.upenn.edu (Michael C Hyzer)
  3. Newsgroups: comp.lang.c
  4. Subject: Writing to a Memory Address
  5. Date: 4 Apr 1996 08:08:25 GMT
  6. Organization: University of Pennsylvania
  7. Message-ID: <4k001p$dqb@netnews.upenn.edu>
  8. NNTP-Posting-Host: red.seas.upenn.edu
  9. X-Newsreader: TIN [version 1.2 PL2-upenn1.3]
  10.  
  11. Hello,
  12. I am running the same gcc for DOS on my pentium desktop and 386 laptop.  
  13. I am trying to write to the address of the parallel port (0x0378 on both 
  14. machines).  When i do it on the desktop, with a command such as:
  15.  
  16. int *para = (char *)0x0378;
  17.  
  18. This line causes a segmentation violation on the laptop.  When I use this 
  19. line on the desktop, it will complete the assignment, and I can read and  
  20. write to the address.  When I boot the desktop without drivers (hitting 
  21. F5 during startup), the C program will not run, and the segmentation 
  22. violation is identical to the laptop.  Another piece of information that 
  23. might help, is that the memory addresses for normal assignments on the 
  24. laptop consists of addresses such as: 0x7FFFFE58.  This is the same 
  25. magnitude of address that the desktop uses when it does not run 
  26. properly.  When the desktop does run properly, it uses addresses such as 
  27. 0x51E54.  It seems that when C uses this block of memory, it can access 
  28. the memory address 0x0378.  But when C is using the high memory, it 
  29. cannot access the low memory, even to read it.  
  30.  
  31. My question is:  Does anyone know how to load gcc so it uses low memory.  
  32. I am using the same memory manager on both machines, and trying to  
  33. duplicate the config.sys, but no luck.  
  34. Does anyone know how to write to an address that is locked out by C using
  35. usual commands.
  36. Is there another easy way to change the pins of the parallel port without 
  37. using C, if using C is unfeasable.  I want to change the voltage at 
  38. certain pins without start and stop bits, or however it normally 
  39. operates.   
  40. If you dont have enough information, or you have suggestions, please 
  41. email me at:
  42. mchyzer@seas.upenn.edu
  43. Thank you very much.
  44. Chris Hyzer
  45.  
  46.